const App=getApp()
const httpRequest=require('../../utils/httpRequest.js')

Page({
  data:{
    movieData: {},
    isF: true,
    cinemas: [],
    Mid:'',
    Token:''
  },

onLoad: function(options) {
  const userToken = wx.getStorageSync('userToken'); 
    this.setData({
      Token:userToken
    });
  const eventChannel = this.getOpenerEventChannel();
  eventChannel.on('acceptDataFromHomePage', (data) => {
    this.setData({
      movieData: data.data
    });
  });
  eventChannel.on('acceptDataFromHomePage1', (data) => {
    this.setData({
      Mid: data.data
    });
    this.getCinemaData();
  });
},

//获取拥有该电影的电影院信息
getCinemaData() {
  const index=this.data.Mid;
  httpRequest.Request('Post',App.globalData.backend_add+'api/getCinemaByMid?id='+index+'&longitude='+118.072243442373+'&latitude='+24.6078449008795,{},{'Authorization': this.data.Token,'content-type': 'application/json'},'cinemas','null',this)
},

//展开和闭合
aa: function() {
  this.setData({
    isF: !this.data.isF
  })
}
  
})